<template>
  <div id="app">
    <div class="bar-content">
      <router-view/>
    </div>
    <div class="bar-nav">
      <div v-for="(item,index) in tabbarDes" :key="item.txt" class="items">
          <img :src="item.normalImg" v-show="flag">
          <img :src="item.activeImg" v-show="!flag">
        <div>
          <router-link class="txt" :to="item.page">{{item.txt}}</router-link>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  export default {
    components: {},
    data: function () {
      return {
        flag: true,
        tabbarDes: [
          {
            txt: '首页',
            page: '/',
            normalImg: require('./assets/index-22.png'),
            activeImg: require('./assets/index-11.png')

          },
          {
            txt: '购物车',
            page: '/cart',
            normalImg: require('./assets/cart-11.png'),
            activeImg: require('./assets/cart-22.png')
          },
          {
            txt: '订单详情',
            page: '/orderList',
            normalImg: require('./assets/order-11.png'),
            activeImg: require('./assets/order-22.png')
          },
          {
            txt: '我的淘宝',
            page: '/mycente',
            normalImg: require('./assets/mycente-11.png'),
            activeImg: require('./assets/mycente-22.png')
          },
        ]
      }
    },
    methods: {}
  }
</script>

<style scoped>
  * {
    text-decoration: none;
    margin: 0;
    padding: 0;
  }
  .items{
    width: 25%;
    color: #5e5e5e;
    text-align: center;
  }
  .items>img{
    width:30%;
    margin-top: 5px;
  }


  .bar-nav {
    display: flex;
    width: 100%;
    box-shadow: 1px -2px 6px #A8A8A8;
    justify-content: space-around;
    height: 60px;
    background-color: #fff;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 999;
  }

  .txt {
    color: black;
    font-size: 15px;
  }

  .bar-content {
    width: 100%;
    height: 100%;

  }




</style>
